package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.UserBean;
import com.project.mapper.IUserMapper;
import com.project.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lyl
 * description:
 */
@Service
@Transactional
public class UserServiceImpl implements IUserService {
    @Autowired
    private IUserMapper iUserMapper;

    @Override
    public PageInfo<UserBean> findAllUser(int pageNo) {
        PageHelper.startPage(pageNo, 3);
        PageInfo<UserBean> info = PageInfo.of(iUserMapper.findAllUser());
        return info;
    }

    @Override
    public void register(UserBean userBean) {
        iUserMapper.register(userBean);
    }


}
